{extend name="base"/} {block name="title"} 地图 {/block} {block name="css"}
<link rel="stylesheet" href="__MOBILE__/css/zhang.css">
<style>
    
</style> 
{/block} {block name="content"}
<iframe id="mapPage"frameborder=0 src="https://apis.map.qq.com/tools/locpicker?search=1&type=1&key=OB4BZ-D4W3U-B7VVO-4PJWW-6TKDJ-WPB77&referer=myapp">
</iframe>
{/block} {block name="js"}
<script>
    window.addEventListener('message', function (event) {
        // 接收位置信息，用户选择确认位置点后选点组件会触发该事件，回传用户的位置信息
        var loc = event.data;

        if (loc && loc.module == 'locationPicker') {
            var city = loc.cityname;
            var lat = loc.latlng.lat;
            var lng = loc.latlng.lng;
            var address = loc.poiaddress;

            $.ajax({
                url:'/mobile/shop/map',
                method:'post',
                data:{city:city,lat:lat,lng:lng,address:address},
                dataType:'JSON',
                success:function(data){
                    if(data.code='0'){
                        msg_alert(data.msg,data.url);
                    }
                    else
                    msg_alert(data.msg,data.url);
                },
                error:function (data) {
                }
            })

        }
    }, false);
</script> {/block}